#ifndef __CURAND_UTILS_H__
#define __CURAND_UTILS_H__

#include <stdio.h>
#include "cuda.h"
#include "cuda_runtime.h"
#include "device_launch_parameters.h"

static void handle_curand_error( curandStatus_t err, const char *file, int line )
{
    if ( err != CURAND_STATUS_SUCCESS )
	{
        printf( "[CURAND] Error in %s at line %d\n", file, line );
        exit( EXIT_FAILURE );
    }
}

#define HANDLE_CURAND_ERROR( err ) ( handle_curand_error( err, __FILE__, __LINE__ ) )

#endif /* __CURAND_UTILS_H__ */
